﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace SageKing.Core.Contracts;

/// <summary>
/// 基础CRUD接口
/// </summary>
/// <typeparam name="TEntity"></typeparam>
/// <typeparam name="TKey"></typeparam>
public interface ICRUDBaseApi<TEntity, TKey> : ISageKingResultPageBase<TEntity>
{
    /// <summary>
    /// HttpGet("{id}")
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    public Task<SageKingResult<TEntity>> GetAsync(TKey id);

    /// <summary>
    /// httpPost
    /// </summary>
    /// <param name="model"></param>
    /// <returns></returns>
    public Task<SageKingResult<TKey>> CreateAsync(TEntity model);

    /// <summary>
    /// httpPut
    /// </summary>
    /// <param name="model"></param>
    /// <returns></returns>
    public Task<SageKingResult<bool>> UpdateAsync(TEntity model);

    /// <summary>
    /// httpDelete("{id}")
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    public Task<SageKingResult<bool>> DeleteAsync(TKey id);
}
